<template>
  <div style="width:100%; padding:10px; ">
    <br><br><br><br>
    <p style="text-align: center; margin:auto; padding: 20px 100px 20px 0px;">
      <img src="static/img/logo.jpg" width="300" style="position :relative; top:8px;" />
      <span style="font-size:26px; font-weight:700;">血液交叉配血报告单</span>
    </p>
    <table style="text-align:left; border-collapse: collapse; width:90%; left:20px; position:relative;">
      <tr>
        <td style=""> <span style="font-weight:600;">
            配血号：</span>{{item.billNo}} </td>
        <td></td>
        <td></td>
        <!--td style=""> <span style="font-weight:600;">
            申请单号：</span>{{item.traMaster.billNo}} </!--td>
        <td-- style=""> <span style="font-weight:600;">
            申请医生：</span>{{getUserName(item.traMaster.creatorUserId)}}</td-->
      </tr>
      <tr>
        <td style=""> <span style="font-weight:600;">
            住院号：</span>{{item.hospitalNumber}}</td>
        <td style=""><span style="font-weight:600;">姓名：</span>{{item.name}}</td>
        <td style=""><span style="font-weight:600;">性别：</span>{{getEnum("BasSex",item.sex)}}</td>
        <td style=""><span style="font-weight:600;">年龄：</span>{{item.age}}</td>
      </tr>
      <!--tr>
        <td style=""> <span style="font-weight:600;">
            患者病区：</span>{{getBasMaterial("Department",item.dependency) }}</td>
        <td style=""> <span style="font-weight:600;">
            床号：</span>{{item.berth}} </td>
      </rt-->
      <!--td style=""> <span style="font-weight:600;">
            临床诊断：</span>{{item.clinicDiagnose}}</td-->
      <tr>
        <td style=""> <span style="font-weight:600;">
            患者ABO：</span>{{item.abo}}</td>
        <td style=""> <span style="font-weight:600;">
            患者Rh(D)：</span>{{item.rhD}} </td>
        <td style=""> <span style="font-weight:600;">复核ABO：</span>{{item.aboResult}}
        </td>
        <td style=""> <span style="font-weight:600;">复核Rh(D)：</span>{{item.rhDResult}}
        </td>
        <!--td style=" ">抗体筛选：抗筛I:--, 抗筛II:--, 抗筛II:-- </td-->
      </tr>

    </table>
    <table style="border-collapse: collapse; width:90%; left:20px; position:relative;">
      <tr>
        <td style="border:1px solid black; text-align: center;">血液流水号</td>
        <td style="border:1px solid black; text-align: center;">血型</td>
        <td style="border:1px solid black; text-align: center;">Rh(D)</td>
        <td style="border:1px solid black; text-align: center;">血液品种</td>
        <td style="border:1px solid black; text-align: center;">血量</td>
        <td style="border:1px solid black; text-align: center;">配血结果</td>
        <td style="border:1px solid black; text-align: center;">配血者</td>
        <td style="border:1px solid black; text-align: center;">复核者</td>
        <td style="border:1px solid black; text-align: center;">配血法</td>
        <td style="border:1px solid black; text-align: center;">复核配血法</td>
        <td style="border:1px solid black; text-align: center;">自编号</td>
      </tr>
      <tr v-for="(blooditem,index) in list" :key="index">
        <td style="border:1px solid black; text-align: center;">
          {{blooditem.invBloodInfo.code}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{blooditem.invBloodInfo.abo}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{blooditem.invBloodInfo.rhD}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{getBasMaterial("BloodVariety",blooditem.invBloodInfo.basBloodVarietyId)}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{blooditem.invBloodInfo.unit}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{getEnum("TraCrossMatchResult",blooditem.result)}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{getUserName(blooditem.matchingUserId)}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{getUserName(blooditem.reviewUserId)}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{blooditem.traPxffId}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{blooditem.reviewTraPxffId}}</td>
        <td style="border:1px solid black; text-align: center;">
          {{blooditem.invBloodInfo.sinceNumber}}</td>
      </tr>
    </table>
    <table style="border-collapse: collapse; width:90%; left:20px; position:relative;">
      <tr>
        <td>报告时间：{{item.reportTime}}
        </td>
      </tr>
      <tr>
        <td>备注：以上血制品检查无异常，血液出库后不得退回</td>
      </tr>
    </table>
  </div>

</template>

<script>
export default {
  name: 'NursingPrint',
  methods: {
    //getBasMaterial(UserId)  //根据用户ID获取用户名
    getUserName() {
      return 'username'
    },

    //getEnum("BasSex",id) //获取枚举名称
    getEnum() {},

    //getBasMaterial("Department",id) //获取部门
    //getBasMaterial("BloodVariety",id) //获取血液品种名称
    //getBasMaterial("BloodVariety",id) //获取血液产品名称
    getBasMaterial() {
      return 'xxx'
    }
  },
  data: function() {
    return {
      item: {
        billNo: 'MAT191214001',
        hospitalNumber: '001',
        rhD: 'RH+',
        abo: 'A',
        name: '张三',
        age: '18',
        sex: 0,
        basDepartmentId: 1,
        aboResult: 'A',
        rhDResult: 'RH+',
        crossBillNo: 'MAT191214001',
        reportTime: '2019-12-18 09:45:24'
      },
      name: '血液交叉配血报告单',
      list: [
        {
          billNo: 'MAT191214001',
          invBloodInfoId: 2,
          traPxffId: '盐水法',
          reviewTraPxffId: '盐水法',
          mainSide: null,
          secondSide: null,
          result: 0,
          matchingDate: '2019-12-14 15:05:33',
          matchingUserId: 2,
          reviewUserId: 2,
          invBloodInfo: {
            code: '440123456789255001',
            ownNumber: null,
            basBloodVarietyId: 0,
            basBloodVarietyName: null,
            basBloodProductId: '001',
            basBloodProductName: null,
            abo: 'A',
            rhD: 'RH+',
            volume: 100,
            unit: 'ml',
            warehousingPrice: 100,
            status: 1,
            specialProcessing: null,
            effectiveDate: '2019-12-14 15:04:06',
            gatheringDate: '2019-12-10 11:04:06',
            makeDate: '0001-01-01 00:00:00',
            bloodDonationCode: '440123456789255',
            isRecycle: false,
            sinceNumber: null,
            basBloodProduct: null,
            isDeleted: false,
            deleterUserId: null,
            deletionTime: null,
            lastModificationTime: '2019-12-14 15:25:21',
            lastModifierUserId: 2,
            creationTime: '2019-12-14 15:05:03',
            creatorUserId: 2,
            id: 2
          }
        },
        {
          billNo: 'MAT191214001',
          invBloodInfoId: 3,
          traPxffId: '盐水法',
          reviewTraPxffId: '盐水法',
          mainSide: null,
          secondSide: null,
          result: 0,
          matchingDate: '2019-12-14 15:05:38',
          matchingUserId: 2,
          reviewUserId: 2,
          invBloodInfo: {
            code: '440123456789355001',
            ownNumber: null,
            basBloodVarietyId: 0,
            basBloodVarietyName: null,
            basBloodProductId: '001',
            basBloodProductName: null,
            abo: 'A',
            rhD: 'RH+',
            volume: 100,
            unit: 'ml',
            warehousingPrice: 100,
            status: 4,
            specialProcessing: null,
            effectiveDate: '2019-12-14 15:04:19',
            gatheringDate: '2019-12-10 11:04:19',
            makeDate: '0001-01-01 00:00:00',
            bloodDonationCode: '440123456789355',
            isRecycle: false,
            sinceNumber: null,
            basBloodProduct: null,
            isDeleted: false,
            deleterUserId: null,
            deletionTime: null,
            lastModificationTime: null,
            lastModifierUserId: null,
            creationTime: '2019-12-14 15:05:03',
            creatorUserId: 2,
            id: 3
          }
        },
        {
          billNo: 'MAT191214001',
          invBloodInfoId: 4,
          traPxffId: '盐水法',
          reviewTraPxffId: '盐水法',
          mainSide: null,
          secondSide: null,
          result: 0,
          matchingDate: '2019-12-14 15:05:43',
          matchingUserId: 2,
          reviewUserId: 2,
          invBloodInfo: {
            code: '440123456789455001',
            ownNumber: null,
            basBloodVarietyId: 0,
            basBloodVarietyName: null,
            basBloodProductId: '001',
            basBloodProductName: null,
            abo: 'A',
            rhD: 'RH+',
            volume: 100,
            unit: 'ml',
            warehousingPrice: 100,
            status: 1,
            specialProcessing: null,
            effectiveDate: '2019-12-14 15:04:32',
            gatheringDate: '2019-12-10 11:04:32',
            makeDate: '0001-01-01 00:00:00',
            bloodDonationCode: '440123456789455',
            isRecycle: false,
            sinceNumber: null,
            basBloodProduct: null,
            isDeleted: false,
            deleterUserId: null,
            deletionTime: null,
            lastModificationTime: '2019-12-14 16:25:35',
            lastModifierUserId: 2,
            creationTime: '2019-12-14 15:05:03',
            creatorUserId: 2,
            id: 4
          }
        }
      ]
    }
  }
}
</script>
